
/* 全局变量 */
//是否为小程序
const isMp = getQuery('containerType') === "mp"
const CODE = getQuery('code')
const DEVICE_UUID = getQuery('deviceUuid')
function getQuery(name) {
    const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)")
    const r = window.location.search.substr(1).match(reg)
    if (r != null) return unescape(r[2])
    return null
}
const u = navigator.userAgent
const isIos = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
//静态资源前缀全局变量
const STATICE_URLTITLE = isMp || !DEVICE_UUID || /^[0-9]+$/.test(DEVICE_UUID) ? "https://hz-huibenxia.oss-cn-shenzhen.aliyuncs.com/Static-library/"
    : "https://load/.nomedia/Static-library/"
// 图片资源前缀全局变量 PC/移动端区分
const IMG_URLTITLE = isMp || !DEVICE_UUID || /^[0-9]+$/.test(DEVICE_UUID) ? "https://hz-huibenxia.oss-cn-shenzhen.aliyuncs.com" :
    "https://load/.nomedia"
// const IMG_URLTITLE = "https://hz-huibenxia.oss-cn-shenzhen.aliyuncs.com"
//浏览器fontsize 
const FONT_SIZE = parseFloat(getComputedStyle(window.document.documentElement)["font-size"])
export default {
    isMp,
    isIos,
    CODE,
    DEVICE_UUID,
    STATICE_URLTITLE,
    IMG_URLTITLE,
    FONT_SIZE
}
